package com.example.controller;

import com.example.service.IDepartmentsService;
import com.nanhang.common.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lmy
 * @since 2025-01-09
 */
@RestController
@RequestMapping("/departments")
public class DepartmentsController {

    @Autowired
    private IDepartmentsService departmentsService;
    @GetMapping("/list")
    public R list() {
        return R.ok().data("list", departmentsService.list());
    }

}
